<template>
    <div class="box">
        <header>
             <span> <img @click="goBack" class="Back"  src="../../../assets/icon/hdpi/fh.png" alt=""></span>
     <span class="purse1">被采纳的建议</span>
        </header>
        <main>
            <div class="recomme_box">
                <div class="recommebg">  

                    <div class="recommebg_box" v-for="(item,index) in data " :key="index">
                       <div class="my_box">
                         <div class="left">
                            <img :src="item.imgs" alt="" style="width: 40px;height: 40px;border-radius: 50%;">
                            <span>{{ item.name }}</span>
                        </div>
                        <div class="right">
                            <p>{{ item.title }}</p>
                            <p>主要病症 : <span>{{ item.disease }}</span></p>
                            <p>采纳时间: <span>{{ item.timea }}</span> </p>
                        </div>
                       </div>
                        <div class="myinfor_box">
                            <b>我的建议</b>
                            <p>
                                {{ item.myinfor }}
                            </p>
                        </div>
                    </div>
                    <div></div>
                    <div></div>
                    <div></div>
                </div>
            </div>
        </main>
    </div>
</template>

<script setup lang="ts">
import {ref} from 'vue'
import { useRouter } from "vue-router";
import {Suggest} from '../../../request/api'
const router = useRouter();

const data=ref([])

Suggest().then(res=>
{
    console.log(res);
    data.value=res.data.data
})

const goBack = () => {
  router.go(-1);
};
</script>

<style scoped>

.box
{
    width: 100vw;
    height: 100%;
}

header
{
    width: 100%;
    height: 50px;
    border-bottom: 1px solid #ccc;
}

.Back
{
    width: 25px;
    height: 25px;
    margin-left: 20px;
    margin-top: 10px;
}
.purse1{
    font-size: 18px;
    margin-left: 98px;
    font-size: 16px;
}

main
{
    width: 100%;
    height: 80%;
}

.recomme_box
{
    width: 100%;
    height: 100%;
}

.recommebg
{
    width: 80%;
    height: 100%;
    /* margin-left: 30px; */
    text-align: center;
    position: relative;
}

.recommebg_box
{
    width: 100%;
    height: 45%;
    border: 1px solid #ccc;
    font-size: 13px;
    margin-left: 30px;
    margin-top: 30px;
    border-radius: 10px;
}

.my_box
{
    width: 100%;
    height: 20%;
    display: flex;
    border: 1px solid #ccc;
}

.left
{
    width: 30%;
    height: 100%;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.right
{
    width: 60%;
    height: 100%;
    margin-left: 20px;
}

.myinfor_box
{
    width: 100%;
    height: 20%;
    font-size: 10px;
}

.myinfor_box b
{
    all: unset;
    margin-left: 0;
    padding-left: 0;
}

.empty 
{
    width: 140px;
    height: 140px;
    position: absolute;
    left: 30%;
    top: 40%;
}

.empty img
{
    width: 100%;
    height: 100%;
}
</style>